package com.prj.ufdm;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.EnvironmentAware;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@EnableScheduling
public class UfdmWebApplication extends SpringBootServletInitializer implements EnvironmentAware  {
	
	private static Environment env; 
	
	public static void main(String[] args) { 
		
		SpringApplication.run(UfdmWebApplication.class, args);
		
		System.out.println("\n WebApplication "+ env.getProperty("server.port") +" 启动成功................");
		
	}
	
	@Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(UfdmWebApplication.class);
    }
	
	@Override
	public void setEnvironment(Environment environment) {
		env = environment;
	}
}
